Skip to content

Use REST endpoints for PR draft state transitions#2816

Open
aalmanasir wants to merge 2 commits into
github:mainfrom
aalmanasir:aalmanasir-fix-draft-pr-conversion
Open

Use REST endpoints for PR draft state transitions#2816
aalmanasir wants to merge 2 commits into
github:mainfrom
aalmanasir:aalmanasir-fix-draft-pr-conversion

Conversation

@aalmanasir

@aalmanasir aalmanasir commented Jul 5, 2026

Copy link
Copy Markdown

Summary

  • replace GraphQL draft-state mutations with REST draft-state transitions in update_pull_request
  • reuse the same REST draft-state helper in update_pull_request_draft_state
  • add tests for no-op behavior and REST 403/404 error handling in both general and granular paths

Notes

  • this branch removes convertPullRequestToDraft and markPullRequestReadyForReview usage from the two affected code paths
  • still needs authenticated runtime smoke test for app-token behavior

Replace GraphQL draft-state mutations with REST calls in both update paths and add coverage for no-op and 403/404 handling in general and granular tools.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@aalmanasir aalmanasir marked this pull request as ready for review July 7, 2026 18:18
@aalmanasir aalmanasir requested a review from a team as a code owner July 7, 2026 18:18
@aalmanasir aalmanasir requested a review from gubonlucid-com July 7, 2026 18:18
@gubonlucid-com

Copy link
Copy Markdown

title: "Prerendering"
description: "Enable prerendering to help robots and crawlers navigate your single-page application and improve your project's SEO. Choose between different prerendering options."

For the complete documentation index for AI agents, see llms.txt.

Set up prerendering to make your app's content discoverable to AI agents, SEO crawlers, and preview services, such as for social media previews.

Overview

Once set up, prerendering automatically serves pre-rendered HTML to crawlers, agents, and preview services, while regular site visitors continue to receive your standard JavaScript application.

Prerendering is designed for apps that use JavaScript to generate page content instead of serving most or all content in HTML, such as for single-page applications (SPAs) built with frameworks like React, Vue, or Angular.

Prerendering options

To help your project with prerendering you have the following recommended options:

Comparing options

Feature Netlify Prerender extension Prerender.io extension
Best for Simple, self-serve setups Business-critical, complex configurations
Setup complexity Minimal configuration Advanced configuration available
API key required No third-party API key needed Prerender.io API key required
Infrastructure Netlify Edge Functions and Functions External service with vendor support
Visibility Full logs and metrics in Netlify Prerender.io dashboard + Netlify logs
Support level Netlify documentation and community Vendor-level support
Enterprise features Basic prerendering Advanced configuration and reliability
Node.js requirement Version 20 or later No specific requirement
Recommended for Most users, simple to moderate needs Enterprise use cases, complex requirements

Check prerendering needs

Not sure if your site/app needs prerendering?

Find out using our prerendering checker tool and your project URL.

Why does my project need prerendering?

SPAs (single-page applications) rely on client-side JavaScript to render pages, leaving the HTML body mostly empty. While this works for browsers and major search engines like Google, many tools, such as AI agents, chat services, and crawlers, cannot run JavaScript. Even search engines that do run JavaScript may penalize slow-loading pages, lowering SEO scores.

Websites using Server-Side Rendering (SSR) or Static Site Generation (SSG) avoid these issues, though some use a hybrid approach.

Netlify Prerender extension

Pricing Information: The Prerender extension replaces the legacy beta prerendering feature, which is now deprecated. Learn more about legacy feature's deprecation timeline.

As a Team Owner, you can install the Prerender extension for your team. Then you or any developer on your team can enable the extension for a project they work on.

Video: Watch video

Important - Node.js version requirement

The Netlify Prerender extension requires Node.js version 20 or later. Using an older version may cause the prerender function to fail with errors such as Chromium launch failures. Make sure your project is configured to use supported Node.js versions. You can set the version using a .node-version, .nvmrc file, or NODE_VERSION environment variable.

To set up the Netlify Prerender extension, follow these steps:

  1. If necessary, disable the legacy built-in Prerendering feature. To disable, go to

NavigationPath Component:

Project configuration > Build & deploy > Post processing > Prerendering
.
2. To install the Prerender extension, go to https://app.netlify.com/extensions/prerender.
3. All your projects will now show the Prerender extension under Extensions in the left sidebar of your project navigation. To enable for a specific project, select the Prerender extension and Enable prerendering.
4. To activate the extension, save your changes and re-deploy your project.

To learn more about advanced configuration options and how this extension works, check out the extension details page.

How it works

Once enabled, the Netlify prerender extension adds two components to your site:

  1. Edge function - Runs only for relevant requests (made by a relevant user-agent for HTML content) and rewrites these requests to the prerender function.
  2. Serverless function - Uses a headless browser to load the requested page, and returns the fully-rendered HTML with proper caching headers.

Your human visitors continue to load your site normally, while crawlers and AI tools receive HTML with all content already rendered. There is no additional cost other than regular billing for the functions invoked, based on your plan. Since the functions are invoked in your account, you get full visibility with logs and metrics - just like for any other function you have deployed.

This extension uses sensible defaults, and very often requires no additional configuration.

After installing the extension to your team, you need to enable it for a specific project.

All other configuration changes beyond enabling/disabling do not require a re-deploy, as these are stored in a blob object.

To learn more about configuration options, check out the extension details page.

External services for prerendering

You can use an external service such as the Prerender.io extension with your Netlify site/app for advanced prerendering needs if you have a Netlify Pro plan or Enterprise plan.

If you are using an external service that relied on the legacy in-app Netlify Prerendering feature (not installed as a Netlify extension), then you will need to update or migrate your prerendering service.

Note - Set up external service before January 6, 2026?

If you set up an external service before January 6, 2026, then it's likely the external service relies on Netlify's in-app legacy prerendering feature, which is deprecated and will no longer work starting on January 20, 2026 for users on free plans. Learn more about how to migrate using the Prerender.io extension or check the full deprecation schedule in this changelog post.

For additional help, reach out to Netlify Support.

Set up the Prerender.io extension

To set up the Prerender.io extension, follow these steps:

  1. Go to https://app.netlify.com/extensions/prerenderio and select Install.
  2. For the Netlify project where you want to install the Prerender.io extension, from the left sidebar of your project overview, select Extensions, then choose Prerender.io and Enable Extension.
  3. From your Prerender.io dashboard, copy your API key. You must sign up with Prerender.io and choose a plan to get an API key. Learn more from the Prerender.io docs.
  4. On your Netlify project dashboard's Prerender.io extension page, paste your API key under Prerender.io token and confirm with Save.
  5. Be sure to save your changes and re-deploy your project to activate the extension.

You have more custom configuration options available from your Prerender.io dashboard. Check out the Prerender.io docs for more information.

Migrate from the legacy Netlify prerendering feature

If you set up the Prerender.io extension before January 6, 2026, then you will need to make some updates to your setup so that the extension doesn't rely on the Netlify legacy prerendering feature, which is deprecated and will stop working on January 20, 2026 for users on the free plan.

Learn more about migrating your Prerender.io extension or the full deprecation schedule.

For more help migrating your Prerender.io extension, reach out to Netlify Support.

Legacy Netlify Prerendering

This feature is deprecated. We recommend disabling it and using another prerendering option. Learn more about the deprecation schedule in our changelog post or how to migrate.

To disable this feature, go to

NavigationPath Component:

Project configuration > Build & deploy > Post processing > Prerendering
.

Enabling Netlify's built-in prerendering.

If enabled, our built-in prerendering service will cache prerendered pages for between 24 and 48 hours; this is not adjustable.

How it works

This is how our Legacy Netlify Prerendering service works:

  1. When a request hits one of our CDN servers, our CDN software determines if it's a prerendering request from a crawler.
  2. If prerendering is enabled for your site, our cache servers will contact the prerendering backend straight from our CDN nodes instead of serving the normal cached request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants